import request from '@/utils/request'
import type {trademark,trademarkResponseData} from './model/trademark'
enum API{
   TRAGEMARKLIST= '/admin/product/baseTrademark',//管理列表
   TRAGEMARKLISTUPDATE='/admin/product/baseTrademark/update',//更改数据
   TRAGEMARKLISTSAVE='/admin/product/baseTrademark/save' ,//添加数据
   DELETETRADEMARK='/admin/product/baseTrademark/remove'

}

//品牌管理列表数据
export const reqTrademarkList=(page:number,limit:number)=>request.get<any,trademarkResponseData>(API.TRAGEMARKLIST +`/${page}/${limit}`)
//获取添加和修改品牌数据
export const reqUpdataTrademark=(data:trademark)=>{
   if(data.id){
      return request.put<any,any>(API.TRAGEMARKLISTUPDATE,data)//添加数据
   }else{
      return request.post<any,any>(API.TRAGEMARKLISTSAVE,data)//修改品牌数据
   }
}
//删除品牌数据
export const reqDeleteTrademark=(id:number)=>request.delete<any,any>(API.DELETETRADEMARK + `/${id}`)

